﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Collections.Specialized;

namespace BlobExplorer
{
    /// <summary>
    /// Interaction logic for ViewMetadata.xaml
    /// </summary>
    public partial class ViewMetadata : Window
    {
        public ViewMetadata(NameValueCollection data)
        {
            InitializeComponent();

            PopulateMetadata(data);
        }

        private void PopulateMetadata(NameValueCollection data)
        {
            if (data != null)
            {
                StringBuilder sb = new StringBuilder();

                foreach (string item in data.Keys)
                {
                    sb.Append(string.Format("{0}:{1}\r\n", item, data[item]));
                }

                metadata.Text = sb.ToString();
            }
        }

        void OnClick(object sender, EventArgs e)
        {
            DialogResult = true;
        }
    }
}
